﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace _201206QuanLyBanHang.ChucNang
{
    class BLL_DMKhuVuc
    {
        DataConn da;
        public BLL_DMKhuVuc()
        {
            da = new DataConn();
        }
        public DataSet getDMKhuVuc(string strsql)
        {
            return da.ExectueQueryDataset(strsql, CommandType.Text, null);
        }
        public DataSet getkhachhang(string strsql)
        {
            return da.ExectueQueryDataset(strsql, CommandType.Text, null);
        }
        public bool insertDMKhuVuc(ref string err, int MaKV, string TenKV, string GhiChu)
        {
            return da.MyExecuteNonQuery("Pro_Insert_DMKhuVuc", CommandType.StoredProcedure, ref err, new SqlParameter("@MaKv", MaKV), new SqlParameter("@TenKV", TenKV), new SqlParameter("@GhiChu", GhiChu));
        }
        public bool deleteDMKhuVuc(ref string err, int MaKV)
        {
            return da.MyExecuteNonQuery("Pro_Delete_DMKhuvuc", CommandType.StoredProcedure, ref err, new SqlParameter("@Makhuvuc", MaKV));
        }
        public bool updateDMKhuVuc(ref string err, int MaKV, string TenKV, string GhiChu)
        {
            return da.MyExecuteNonQuery("Pro_Update_DMKhuVuc", CommandType.StoredProcedure, ref err, new SqlParameter("@MaKV", MaKV), new SqlParameter("@TenKV", TenKV), new SqlParameter("@GhiChu", GhiChu));
        }
        public object layma(ref string err, string str)
        {

            return da.lay(str, CommandType.Text, ref err);


        }
    }
}
